<%@include file="/commons/decelerations.jsp" %>

<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<title>Role List</title>
	</head>
	
	<body>
		<h1>Role List</h1>
		<table id = "RoleListTable" border = "3">
			<tr>
    			<th>Role ID</th>
    			<th>Role Name</th>
    			<th>Delete</th>
			</tr>
			
			<c:forEach var="role" begin="0" items="${requestScope.roleList}">
   				<tr>
    				<td><a href="MaintainRole?roleId=${role.roleId}">${role.roleId}</a>&nbsp;&nbsp;</td>
    				<td>${role.roleName}&nbsp;&nbsp;</td>
    				<td><a href="DeleteRole?roleId=${role.roleId}">Delete</a></td>
				</tr> 
			</c:forEach>			
		</table>
		<p>
		<a href="CreateRole.jsp"><strong>Create new Role</strong></a>
		&nbsp;&nbsp;
		<a href="../"><strong>Main Menu</strong></a>
	</body>
</html>

<c:if test='${warning eq 0}'>
	<script type="text/javascript">
		
		alert("This Role ID is related to persons, so can't be deleted.");
		
	</script>
</c:if>